package 代码记录.Bit48天集训;

import java.util.Scanner;

/**选择题答案已订正
 * 1.统计回文(已搞定)
 * 2.连续最大和(未搞定)
 * @author zx
 * @create 2022-04-22 20:33
 */
public class day_05 {
    /**
     * 时间复杂度过大,O(N^2)
     * @param args
     */
    public static void main2(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for(int i = 0;i < n;i++){
            arr[i] = sc.nextInt();
        }
        int max = Integer.MIN_VALUE;
        for(int i = 0;i < n;i++){
            int sum = 0;
            for(int j = i;j < n;j++){
                sum += arr[j];
                if(sum > max){
                    max = sum;
                }
            }
        }
        System.out.println(max);
    }
    /**
     * @param args 自己做出来了
     */
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String A = sc.nextLine();
        String B = sc.nextLine();
        int res = 0;
        for(int i = 0;i < A.length();i++){
            String str = A.substring(0,i) + B + A.substring(i,A.length());
            if(judge(str)){
                res++;
            }
        }
        if(judge(A + B)){
            res++;
        }
        System.out.println(res);
    }
    //判断一个字符串是否回文
    private static boolean judge(String str){
        char[] arr = str.toCharArray();
        int left = 0;
        int right = arr.length - 1;
        while(left <= right){
            if(arr[left] != arr[right]){
                return false;
            }
            left++;
            right--;
        }
        return true;
    }
}
